<template>
  <div class="lis">
    <div class="iphonelist">
      <dl>
        <dt>
          <img :src="list.img" alt />
        </dt>
        <dd>
          <div class="info">
            <span>{{list.phone}}</span>
            <p>高级经纪人:{{list.name}}</p>
          </div>
          
        </dd>
      </dl>
      <p>
            <van-icon name="arrow" />
          </p>
      <!-- 在一个盒子里给父系元素加display:flew 能让里面的东西在一行 -->
    </div>
    <div class="center">
      <span style="font-size:20px">我的回答</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="center">
      <span style="font-size:20px">预约管理</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="center">
      <span style="font-size:20px" @click="df">二手房</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="center">
      <span style="font-size:20px">出租房</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="center">
      <span style="font-size:20px">写字楼</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="center">
      <span style="font-size:20px">商铺</span>

      <p class="icon">
        <van-icon name="arrow" />
      </p>
    </div>
    <div class="bottom">
      <button @click="tui">退出登录</button>
    </div>
  </div>
</template>

<script>
import { getuserinfo } from "../api/user.js";
export default {
  data() {
    return {
      list: [],
      token: ""
    };
  },
  created() {
      //拿到token值是getItem,这个不是获取
      //保存 token值用setItem
    this.token = localStorage.getItem("token");
    this.getinfo();
  },
  methods: {
    getinfo() {
      getuserinfo({ token: this.token }).then(res => {
        this.list = res.data;
        
      });
    },
    tui() {
      localStorage.removeItem("token");
      this.$router.push("/login");
    },
    df(){
      this.$router.push("/kj")
    }
  }
};
</script>
<style lang="scss">
.lis {
  width: 100%;
  height: 115px;
  background: gainsboro;
}
 img {
  width: 65px;
  height: 65px;
  border-radius: 50%;
 
}
.iphonelist {
  width: 100%;
  height: 120px;
  padding: 20px;
  display: flex;
  align-items: center;
  dl {
    width: 100%;
    display: flex;
   
    dt {
      width: 58px;
      height: 58px;
      border: 1px solid black;
      border-radius: 50%;
      img {
        border-radius: 50%;
        width: 58px;
        height: 58px;
      }
    }
    dd {
      display: flex;
      justify-content: space-between;
    //   padding-left: 20px;
      align-items: center;
      .info {
        span {
          font-size: 18px;
          padding-bottom: 10px;
          margin-left: 20px;
        }
        p {
          border: 1px solid black;
        //   padding: 3px 5px;
          border-radius: 5px;
        }
      }
    }
  }
  p{
      font-size: 25px;
  }
}
.brokerlist {
  margin-left: 20px;
}
.lop {
  display: flex;
}
:first-child button {
  background: #fff;
  border-radius: 10px;
  padding: 0px 15px;
  height: 30px;
}
p:first-child {
  font-size: 26px;
  margin-bottom: 10px;
}
.vaicon {
  margin-left: 110px;
  font-size: 30px;
  color: azure;
}
.center {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  padding-top: 20px;

  border-bottom: 1px #ccc solid;
}
.icon {
  color: #000;
  font-size: 30px;
}
.bottom {
  text-align: center;
  margin-top: 30px;
}
.bottom button {
  width: 93%;
  height: 50px;
}
</style>